package com.google.gwt.gfx.client.graphics.svg;

import com.google.gwt.gfx.client.graphics.Graphic;
import com.google.gwt.gfx.client.style.StrokeStyle;
import com.google.gwt.user.client.Element;

public class SVGStrokeStyle extends StrokeStyle {

	public SVGStrokeStyle(Graphic g) {
		super(g);
	}

	public SVGStrokeStyle(Graphic g, Element element) {
		super(g, element);
	}

	@Override
	public String getColor() {
		return SVG.getElementProperty(element(), "stroke");
	}

	@Override
	public double getOpacity() {
		return Double.parseDouble(SVG.getElementProperty(element(),
				"stroke-opacity"));
	}

	@Override
	public int getWidth() {
		return Integer.parseInt(SVG.getElementProperty(element(),
				"stroke-width"));
	}

	@Override
	public void setColor(String color) {
		SVG.setElementProperty(element(), "stroke", color);
	}

	@Override
	public void setOpacity(double opacity) {
		SVG.setElementProperty(element(), "stroke-opacity",
				String.valueOf(opacity));
	}

	@Override
	public void setWidth(int width) {
		SVG.setElementProperty(element(), "stroke-width", width + "");
	}

}
